package com.wyix;


import com.wyix.entity.Order;
import com.wyix.entity.Product;
import com.wyix.entity.User;

/**
 * @author wangdx
 * @date 2025/8/1
 * @description
 */
public class EcommerceExample {
    public static void main(String[] args) {
        // 商品信息管理
        Product product = new Product("智能手机", (short) 5000, 100, 4999.99);
        System.out.println("商品信息: " + product);

        // 订单处理
        Order order = new Order(1, (byte) 10, product);
        System.out.println("订单信息: " + order);

        // 用户登录验证
        User user = new User("admin", "123456");
        boolean isLoggedIn = user.login("admin", "123456");
        if (isLoggedIn) {
            System.out.println("用户登录成功");
        } else {
            System.out.println("用户登录失败");
        }
    }
}
